﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace Logging
{
    public class ConsoleLogger : LoggerBase
    {
        public bool EnableTrace { get; set; }
        public ConsoleLogger(bool enableTrace)
        {
            EnableTrace = enableTrace;
        }

        public override void Log(string logInfo, LogLevel level)
        {
            var log = string.Format("[{0}] {1}", Enum.GetName(level.GetType(), level), logInfo);
            Console.WriteLine(log);
            if (EnableTrace)
            {
                Trace.WriteLine(log);
            }
        }
    }
}
